from os import path
import upyun
class Myup:
    def __init__(self):
        self.up = upyun.UpYun('image-clw','chengliwei','Uxx42NVvxZN5MbE8N3DCK9dr1F3WOTz2')

    # 上传文件
    def upload(self,userid,file,upload_dir):
        p = str(upload_dir)+str(userid)+'/'+str(file)
        with open(p,'rb') as f:
            self.up.put("/"+str(userid)+"/"+str(file),f)



myupyun = Myup()
myupyun.upload(1,'3fd1c0fbe1014347a1bee08b18c44949.jpeg','F:/p6/p6_education/static/upload/')
